package com.client.dbdao;

import com.admin.bean.FindInfor;
import com.data.dbdao.BaseDao;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Administrator
 */
@Repository
public class FindLookDao extends BaseDao {
    public List<FindInfor> FindListDao() {
        String hql = "select id,title,tag,type,url from FindInfor where state=? ORDER BY ctime DESC";
        return (List<FindInfor>) super.findMassageDao(hql, true);
    }

    /**
     * 根据id查看发现的信息
     *
     * @param id
     * @return
     */
    public List<FindInfor> lookContentImageDao(String id) {
        String hql = "from FindInfor where id=?";
        return (List<FindInfor>) super.findMassageDao(hql, id);
    }

    public void updateNumDao(String id) {
        String hql = "update FindInfor set num=num+1  where id=?";
        super.updateOneMssageDao(hql, id);
    }
}
